/**
 * 
 */
package com.itee.protocal.meta;

/**
 * @author chenhl
 *
 */
public enum ChannelFeature {
	MICROPOWER_WIRELESS("微功率无线"), SINGAL_SINGAL("单相供电单相传输"),
	SINGAL_THREE("单相供电三相传输"),THREE_THREE("三相供电三相传输");
	
	private String name;
	
	private ChannelFeature(String name){
		this.name = name;
	}
	
	private String getName(){
		return name;
	}
	
	public byte getChannelFeatureByte() 
	{
		switch (this) 
		{
		case MICROPOWER_WIRELESS:
			return 0x00;
		case SINGAL_SINGAL:
			return 0x01;
		case SINGAL_THREE:
			return 0x02;	
		case THREE_THREE:
			return 0x03;	
		default:
			return 0x03;
		}		
	}

	public static ChannelFeature valueOfFeature(byte b) {
		switch (b) {
		case (byte) 0x00:
			return MICROPOWER_WIRELESS;
		case (byte) 0x01:
			return SINGAL_SINGAL;
		case (byte) 0x02:
			return SINGAL_THREE;
		case (byte) 0x03:
			return THREE_THREE;
		default:
			return THREE_THREE;
		}
	}
}
